/* eslint-disable @typescript-eslint/no-extraneous-class */
import { NgModule } from '@angular/core'
import { BrowserModule, BrowserTransferStateModule } from '@angular/platform-browser'
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
import { CommonModule } from '@angular/common'
import { FormsModule } from '@angular/forms'
import { RouterModule } from '@angular/router'
import { ClipboardModule } from '@angular/cdk/clipboard'
import { TransferHttpCacheModule } from '@nguniversal/common'
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'
import { HttpClientModule } from '@angular/common/http'

import { AppComponent } from './app.component'
import { CommonAppModule } from 'src/common'

import '@fortawesome/fontawesome-svg-core/styles.css'

const ROUTES = [
  {
    path: '',
    loadChildren: () => import(/* webpackChunkName: "app" */'./app').then(m => m.ApplicationModule),
  },
  {
    path: 'app',
    redirectTo: '/',
  },
  {
    path: 'login',
    loadChildren: () => import(/* webpackChunkName: "login" */'./login').then(m => m.LoginModule),
  },
]

@NgModule({
  imports: [
    BrowserModule.withServerTransition({
      appId: 'tabby',
    }),
    BrowserTransferStateModule,
    CommonAppModule.forRoot(),
    TransferHttpCacheModule,
    BrowserAnimationsModule,
    CommonModule,
    FormsModule,
    FontAwesomeModule,
    ClipboardModule,
    HttpClientModule,
    RouterModule.forRoot(ROUTES),
  ],
  declarations: [
    AppComponent,
  ],
  bootstrap: [AppComponent],
})
export class AppModule { }
